package com.subject.common.enums;

import lombok.Getter;

/**
 * 操作人类别枚举
 */

@Getter
public enum OperatorType {
    // 其他
    OTHER(0, "其他"),

    // 后台
    MANAGE(1, "后台"),

    // 用户
    USER(2, "用户");

    private final int code;
    private final String msg;

    OperatorType(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public static OperatorType getOperatorType(int code) {
        for (OperatorType operatorType : OperatorType.values()) {
            if (operatorType.getCode() == code) {
                return operatorType;
            }
        }
        return null;
    }
}
